:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.card {
  padding: 2em;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #app {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.home, .publish, .my-tasks, .task-detail, .manage, .chat {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: #f7f7f7;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

/* 减少卡片间距 */
.task-card {
  margin-bottom: 8px !important;
}

/* 优化搜索框间距 */
.search-bar {
  margin-bottom: 8px !important;
}

/* 确保底部按钮不遮挡内容 */
.publish-btn {
  position: fixed;
  right: 16px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 16px 0 rgba(39,174,96,0.18);
  padding: 0;
}

/* 聊天页面底部输入框固定 */
.chat-bar {
  z-index: 1000;
}

/* 减少页面内边距 */
.home, .publish, .my-tasks, .task-detail, .manage {
  padding: 0 !important;
}

/* 卡片内容紧凑 */
.task-card {
  padding: 12px !important;
}

/* 确保头部背景覆盖全宽 */
.header-bg {
  position: absolute;
  left: 0; right: 0; top: 0;
  width: 100%;
  min-width: 0;
  height: 160px;
  background: linear-gradient(180deg, #6fd6b6 0%, #a7e6d7 100%);
  z-index: 0;
}

/* 全局按钮样式优化 */
.van-button {
  border-radius: 22px !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  height: 44px !important;
  line-height: 44px !important;
}

.van-button--primary {
  background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3) !important;
}

.van-button--danger {
  background: linear-gradient(135deg, #FF3B30 0%, #CC2E26 100%) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3) !important;
}

.van-button--warning {
  background: linear-gradient(135deg, #FF9500 0%, #CC7700 100%) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3) !important;
}

/* 搜索框样式优化 */
.van-search {
  background: transparent !important;
}

.van-search__content {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 20px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* 输入框样式优化 */
.van-field__control {
  font-size: 16px !important;
  line-height: 1.4 !important;
}

/* 卡片阴影优化 */
.task-card, .card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s ease !important;
}

.task-card:active, .card:active {
  transform: scale(0.98) !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12) !important;
}

/* 图标按钮优化 */
.van-icon {
  transition: all 0.2s ease !important;
}

.van-icon:active {
  transform: scale(0.9) !important;
}

/* 滚动条优化 */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

/* 触摸反馈优化 */
* {
  -webkit-tap-highlight-color: transparent;
}

/* 字体优化 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
